#![cfg(test)]

use super::*;
use soroban_sdk::{symbol_short, vec, Env, log, Bytes, contracttype,U256, Address, Symbol,String};


#[contracttype]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct EncodeInfo {
    pub task_id: Bytes,
    pub network_id: U256,
    pub contract_addr: Address,
    pub wmb_receive: Symbol,
    pub message_type: String,
    pub nft_contract: Address,
    pub nft_id: i128,
    pub price_token: Bytes,
    pub price:i128,
    pub recipent: Bytes,
    pub buyer:Address,
    pub evm_source_chain_id: U256,
    pub evm_source_contract: Bytes

}

#[test]
fn test() {
    let env = Env::default();

    let info = hex::decode("00000011000000010000000d0000000f000000077461736b5f6964000000000d00000040666465313563636539616337646364633466316239653231343264333265303030396639313866313562366361633536623761356237656235633735313062340000000f0000000a6e6574776f726b5f696400000000000b0000000000000000000000000000000000000000000000000000000000015f910000000f0000000d636f6e74726163745f6164647200000000000012000000019935eb84a869521795e1d7114c1f9f9f6ccf9ac121c71ccbe0a5b7c2d390d84f0000000f0000000b776d625f72656365697665000000000f0000000a776d625265636569766500000000000f0000000c6d6573736167655f747970650000000e0000000b43616e63656c4f72646572000000000f0000000c6e66745f636f6e74726163740000001200000001a4434f536a960548542fe68a3e084b7ef72da6b3d4c6547a6bebadf187eeb3c80000000f000000066e66745f696400000000000a00000000000000000000000000004e250000000f0000000b70726963655f746f6b656e000000000d00000028424234453939326461413661353138373243313542663964623866303732363234623931443337420000000f0000000570726963650000000000000a0000000000000000000000000001e2400000000f000000087265636970656e740000000d00000028424234453939326461413661353138373243313542663964623866303732363234623931443337420000000f000000056275796572000000000000120000000000000000cfa226440a5b340f0015259d990083a6863f25b8e3ee4b9b2802b069aeaa640d0000000f0000001365766d5f736f757263655f636861696e5f6964000000000b00000000000000000000000000000000000000000000000000000000000138810000000f0000001365766d5f736f757263655f636f6e7472616374000000000d0000002842423445393932646141366135313837324331354266396462386630373236323462393144333742").unwrap();
    let info_bytes = Bytes::from_slice(&env, &info);
    let encodeInfo = EncodeInfo::from_xdr(&env, &info_bytes).unwrap();

    log!(&env, "{}", encodeInfo)

}
